package cn.zhentao.charge.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.zhentao.charge.mapper.ChargeGlobalPropertyMapper;
import cn.zhentao.charge.domain.ChargeGlobalProperty;
import cn.zhentao.charge.service.IChargeGlobalPropertyService;

/**
 * 全局常量配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-15
 */
@Service
public class ChargeGlobalPropertyServiceImpl implements IChargeGlobalPropertyService 
{
    @Autowired
    private ChargeGlobalPropertyMapper chargeGlobalPropertyMapper;

    /**
     * 查询全局常量配置
     * 
     * @param id 全局常量配置主键
     * @return 全局常量配置
     */
    @Override
    public ChargeGlobalProperty selectChargeGlobalPropertyById(Integer id)
    {
        return chargeGlobalPropertyMapper.selectChargeGlobalPropertyById(id);
    }

    /**
     * 查询全局常量配置列表
     * 
     * @param chargeGlobalProperty 全局常量配置
     * @return 全局常量配置
     */
    @Override
    public List<ChargeGlobalProperty> selectChargeGlobalPropertyList(ChargeGlobalProperty chargeGlobalProperty)
    {
        return chargeGlobalPropertyMapper.selectChargeGlobalPropertyList(chargeGlobalProperty);
    }

    /**
     * 新增全局常量配置
     * 
     * @param chargeGlobalProperty 全局常量配置
     * @return 结果
     */
    @Override
    public int insertChargeGlobalProperty(ChargeGlobalProperty chargeGlobalProperty)
    {
        chargeGlobalProperty.setCreateTime(DateUtils.getNowDate());
        return chargeGlobalPropertyMapper.insertChargeGlobalProperty(chargeGlobalProperty);
    }

    /**
     * 修改全局常量配置
     * 
     * @param chargeGlobalProperty 全局常量配置
     * @return 结果
     */
    @Override
    public int updateChargeGlobalProperty(ChargeGlobalProperty chargeGlobalProperty)
    {
        return chargeGlobalPropertyMapper.updateChargeGlobalProperty(chargeGlobalProperty);
    }

    /**
     * 批量删除全局常量配置
     * 
     * @param ids 需要删除的全局常量配置主键
     * @return 结果
     */
    @Override
    public int deleteChargeGlobalPropertyByIds(Integer[] ids)
    {
        return chargeGlobalPropertyMapper.deleteChargeGlobalPropertyByIds(ids);
    }

    /**
     * 删除全局常量配置信息
     * 
     * @param id 全局常量配置主键
     * @return 结果
     */
    @Override
    public int deleteChargeGlobalPropertyById(Integer id)
    {
        return chargeGlobalPropertyMapper.deleteChargeGlobalPropertyById(id);
    }
}
